# -*-coding:utf-8-*-

import tensorflow as tf

# stddev= 标准差
w1 = tf.Variable(tf.random_normal([2, 3], stddev=1, seed=1))
w2 = tf.Variable(tf.random_normal([3, 1], stddev=1, seed=1))
'''
1. feature： 特征值，一般作为参数传入
'''
# feature = tf.constant([[0.7, 0.9]])
feature = tf.placeholder(tf.float32, shape=(3, 2), name='input')

a = tf.matmul(feature, w1)
b = tf.matmul(a, w2)

with tf.Session() as sess:
    '''
     函数初始化两种方式：
    1. 单个初始化
    2. 全局初始化
    '''
    # sess.run(w1.initializer)
    # sess.run(w2.initializer)
    sess.run(tf.global_variables_initializer())
    print(sess.run(b, feed_dict={feature: [[1.0, 2.0], [1.1, 2.1], [1.2, 2.2]]}))

print (tf.global_variables())
